package org.jeecg.modules.online.low.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.online.low.entity.LowAppMenu;

import java.util.List;

/**
 * @Description: low_app_menu
 * @Author: jeecg-boot
 * @Date: 2021-07-13
 * @Version: V1.0
 */
public interface LowAppMenuMapper extends BaseMapper<LowAppMenu> {

    /**
     * 其他菜单orderNum自减1
     *
     * @param appId
     * @param parentId
     * @param orderNum
     * @return
     */
    int otherOrderNumMinus(@Param("appId") String appId, @Param("parentId") String parentId, @Param("orderNum") int orderNum);

    /**
     * 查询被逻辑删除的菜单
     */
    List<LowAppMenu> selectLogicDeleted(@Param(Constants.WRAPPER) Wrapper<LowAppMenu> wrapper);

    /**
     * 还原被逻辑删除的菜单
     */
    int revertLogicDeleted(@Param("entity") LowAppMenu entity, @Param(Constants.WRAPPER) Wrapper<LowAppMenu> wrapper);

    /**
     * 彻底删除被逻辑删除的菜单
     */
    int deleteLogicDeleted(@Param(Constants.WRAPPER) Wrapper<LowAppMenu> wrapper);

    /**
     * 彻底删除被逻辑删除的表单设计器菜单
     */
    int deleteLogicDeletedByDesformId(@Param("idList") List<String> idList);

    /**
     * 查询Online表单详情
     */
    JSONObject queryCgformDetail(@Param("cgformId") String cgformId);

}
